package com.example.helloandroid;


import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class HelloAndroid extends Activity {
    //private static final String TAG = "HelloAndroid";
    private TextView mStatus;
    private Button mStart;
    private Button mStop;
    private Button mCheck;
    private Button mExit;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        ClickListener listener = new ClickListener();
        mStatus = (TextView) findViewById(R.id.status);
        mStatus.setText("Status ...");
        mStart = (Button) findViewById(R.id.start);
        mStart.setOnClickListener(listener);
        mStop = (Button) findViewById(R.id.stop);
        mStop.setOnClickListener(listener);
        mCheck = (Button) findViewById(R.id.check);
        mCheck.setOnClickListener(listener);
        mExit = (Button) findViewById(R.id.exit);
        mExit.setOnClickListener(listener);
    }

    class ClickListener implements OnClickListener {
        @Override
        public void onClick(View v) {
            if (v == mStart) {
                doStart();
            } else if (v == mStop) {
                doStop();
            } else if (v == mCheck) {
                doCheck();
            } else if (v == mExit) {
                HelloAndroid.this.finish();
                return;
            }
        }
    }

    private void doStart() {
        new TempTest().doTest(this);
    }

    private void doStop() {
    }

    private void doCheck() {
    }
}
